package com.aspose.cells.b.a.a;

import com.aspose.cells.CollectionBase;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collection;

public class ze {
   public static void a(ArrayList var0, CollectionBase var1) {
      if (var1 != null) {
         try {
            int var2 = var1.getCount();

            for(int var3 = 0; var3 < var2; ++var3) {
               var0.add(var1.get(var3));
            }

         } catch (Exception var4) {
            throw new RuntimeException(var4);
         }
      }
   }

   public static void a(ArrayList var0, Object[] var1) {
      for(int var2 = var0.size() - 1; var2 > -1; --var2) {
         var1[var2] = var0.get(var2);
      }

   }

   public static void a(ArrayList var0, int var1, int var2) {
      if (var1 >= 0 && var2 >= 0) {
         if (var0.size() - var1 < var2) {
            throw new IllegalArgumentException("Argument_InvalidOffLen");
         } else {
            if (var2 > 0) {
               for(int var3 = 0; var3 < var2; ++var3) {
                  var0.remove(var1);
               }
            }

         }
      } else {
         throw new IndexOutOfBoundsException(var1 < 0 ? "index" : "count");
      }
   }

   public static void b(ArrayList var0, Object[] var1) {
      if (var1 != null) {
         for(int var2 = 0; var2 < var1.length; ++var2) {
            var0.add(var1[var2]);
         }

      }
   }

   public static void a(ArrayList var0, Collection var1) {
      var0.addAll(var1);
   }

   public static int a(ArrayList var0, Object var1) {
      var0.add(var1);
      return var0.size() - 1;
   }

   public static Object a(ArrayList var0, Class var1) {
      if (var1 == Double.TYPE) {
         var1 = Double.class;
      } else if (var1 == Integer.TYPE) {
         var1 = Integer.class;
      } else if (var1 == Short.TYPE) {
         var1 = Short.class;
      } else if (var1 == Byte.TYPE) {
         var1 = Byte.class;
      } else if (var1 == Character.TYPE) {
         var1 = Character.class;
      } else if (var1 == Boolean.TYPE) {
         var1 = Boolean.class;
      }

      Object[] var2 = (Object[])((Object[])Array.newInstance(var1, var0.size()));
      return var0.toArray(var2);
   }
}
